# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=python-markdown2
pkgver=2.4.10
pkgrel=1
pkgdesc='A fast and complete implementation of Markdown in Python'
arch=('any')
url='https://github.com/trentm/python-markdown2'
license=('MIT')
depends=('python' 'python-pygments')
makedepends=('python-setuptools')
checkdepends=('python-tox-current-env')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('587d132f328b7432b39cb0f33bb2fc03715f44cedef06ecafff6712006e01e800f38cbd1ed9a9b061925e63e7a40de6b3cb751bb5e4bfac372264ebaef899c17')

build() {
  cd $pkgname-$pkgver

  python setup.py build
}

check() {
  cd $pkgname-$pkgver

  local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
  tox -e "py${python_version}" --current-env
}

package() {
  cd $pkgname-$pkgver

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -Dm 644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
